<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  created(){
    console.log("进入到appcreated")
    let userObjobj;
    let isAndroid=this.$isAndroid();

    if(isAndroid){
      console.log("come in android get====== userObj")
      let userstr= window.android.getUserInfo();
      console.log("param==>"+userstr);
      userObjobj=JSON.parse(userstr);
      let ServerUrlStr=window.android.getServerUrl();
      console.log("ServerUrlStr==>"+ServerUrlStr);
      let serverUrlObj=JSON.parse(ServerUrlStr);
      this.$myConfig.ip=serverUrlObj.main_url;
      this.$myConfig.baseIp=serverUrlObj.second_url;
    }else{
      userObjobj= {
        "userObj": {
          "icon": "",
          "userid": "2c9287db6e7e3851016e7e5cc4720002",
          "tenantid": "YJB",
          "orgcode": "9e3a61f58f5e48a4878ad3e4b84e1888",
          "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ6YnkiLCJleHAiOjE1NzgzMDM1OTcsImlhdCI6MTU3ODI3ODUxNH0.pW5h8Ibheq6afLP7TCooQEsUk5D0hVx8ImAowfubVn0",
          "username": "张国中",
          "loginName": "zby",
          "regionCode": null,
          "orgname": "应急管理部"
        },
        "middlemenu": [
          {
            "menualias": "",
            "menuid": "2c9282d76efa1578016efa6c73090004",
            "menumodule": null,
            "menuname": "值班动态",
            "operation": "update,query,delete,add",
            "submenu": []
          },
          {
            "menualias": "",
            "menuid": "2c9282d76efa1578016efa6cc3390005",
            "menumodule": null,
            "menuname": "案例",
            "operation": "delete,add,update,query",
            "submenu": []
          },
          {
            "menualias": "",
            "menuid": "2c9282d76efa1578016efa6d68d60007",
            "menumodule": null,
            "menuname": "周工作安排",
            "operation": "add,query,delete",
            "submenu": []
          },
          {
            "menualias": "",
            "menuid": "2c9282d76efa1578016efa6d99b90008",
            "menumodule": null,
            "menuname": "统计信息",
            "operation": "add,update,query,delete",
            "submenu": []
          },
          {
            "menualias": "",
            "menuid": "2c9282d76efa1578016efa6dd5890009",
            "menumodule": null,
            "menuname": "舆情管理",
            "operation": "add,update,query,delete",
            "submenu": []
          }
        ]
    }
    };
    console.log("user info ==>"+JSON.stringify(userObjobj.userObj))
    this.$store.commit("setUserInfo",userObjobj.userObj);//赋值user信息
    this.$store.commit("setMenuPriv",userObjobj.middlemenu);//赋值菜单权限功能
  },
  mounted(){
  }
};
</script>

<style>
#app {
  height: 100%;
  width: 100%;
}
.el-radio__inner,.el-checkbox__inner{
  border-color:#c6c8c9;
}
</style>
